// pages/userManager/jijian.js
//获取应用实例
const app = getApp()
var util = require('../../utils/util.js')
var http = require('../../utils/server.js')

Page({
  data: {

  },
  onLoad: function(options) {
    var that = this;
    //用户信息
    http.post({
      url: "address/getSendAddress",
      type: ''
    }, function(data) {
      console.log('寄件信息', data)
      that.setData({
        data: data
      });
    })
  },
  formSubmit: function(e) {
    console.info(e.detail.value);
    var that = this;
    //用户信息
    http.post({
      url: "address/editSendAddress",
      consignor: e.detail.value.consignor,
      phone: e.detail.value.phone
    }, function(data) {
      console.log('寄件信息', data)
      util.showSuccess('设置成功', function() {
        wx.navigateBack({
          delta: 1
        })
      })
    })
  }
})